//登录
function int() {
    let formEle = document.querySelector('form')
    formEle.addEventListener('submit', function (e) {
        e.preventDefault()
        let name = $('input[name="name"]').val()
        let password = $('input[name="password"]').val()
        //调取注册接口  
        axios({
            method: 'post',
            url: 'http://api.yuguoxy.com/api/member/login',
            data: {
                username: name,
                password: password
            },
        }).then(response => {
            let data = response.data
            // console.log('结果',data);
            if (data.resultCode == 1) {
               data.resultInfo
               alert('登录成功')
              location.href='../pages/index.html'             
            }else {
                alert('用户名，密码出错')
            }
        })
    })
}
int()